home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(enterFrame){
- if(_currentframe == 1)
- {
- if(_name != "shipORLON")
- {
- xspeed = speed * Math.sin((_rotation * -1 + 180) * 0.017453292519943295);
- yspeed = speed * Math.cos((_rotation * -1 + 180) * 0.017453292519943295);
- _X = _X + xspeed;
- _Y = _Y + yspeed;
- xx = random(120);
- if(xx == 0)
- {
- speed = 17;
- timer = 70;
- }
- timer -= 1;
- if(timer == 0)
- {
- speed = 8;
- }
- var i = 0;
- while(i <= 20)
- {
- if(sh.harea.hitTest(_root["hmn" + i]))
- {
- life -= _root["hmn" + i].dmg;
- sh.play();
- removeMovieClip(_root["hmn" + i]);
- rr = random(5);
- if(rr == 0 && started)
- {
- _rotation = random(360);
- }
- }
- i++;
- }
- if(_root.ship.sh.hitTest(sh.harea))
- {
- _root.ship.play();
- }
- if(life <= 0)
- {
- play();
- }
- yy = random(40);
- if(yy == 0)
- {
- _root.fire(this);
- }
- if(started)
- {
- if(_X < rad)
- {
- _rotation = -1 * _rotation;
- _X = rad;
- }
- if(_X > 550 - rad)
- {
- _rotation = -1 * _rotation;
- _X = 550 - rad;
- }
- if(_Y > 400 - rad)
- {
- _rotation = -1 * _rotation + 180;
- _Y = 400 - rad;
- }
- if(_Y < rad)
- {
- _rotation = -1 * _rotation + 180;
- _Y = rad;
- }
- }
- if(_Y > rad * 2 && !started)
- {
- started = true;
- speed = 8;
- }
- }
- if(_root.rem == true)
- {
- removeMovieClip(this);
- }
- }
- }
-